home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form5
- BorderStyle = 1 'Fixed Single
- Caption = "User Dictioary"
- ClientHeight = 4620
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 7440
- ControlBox = 0 'False
- LinkTopic = "Form5"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4620
- ScaleWidth = 7440
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton cmdOk
- Caption = "&Ok"
- Default = -1 'True
- Height = 375
- Left = 5520
- TabIndex = 7
- Top = 4080
- Width = 855
- End
- Begin VB.CommandButton cmdAdd
- Caption = "&Add"
- Enabled = 0 'False
- Height = 375
- Left = 6480
- TabIndex = 3
- Top = 1680
- Width = 855
- End
- Begin VB.CommandButton cmdDelete
- Caption = "&Delete"
- Enabled = 0 'False
- Height = 375
- Left = 3840
- TabIndex = 5
- Top = 3600
- Width = 855
- End
- Begin VB.CommandButton cmdModify
- Caption = "&Modify"
- Enabled = 0 'False
- Height = 375
- Left = 3840
- TabIndex = 6
- Top = 4080
- Width = 855
- End
- Begin VB.CommandButton cmdClose
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 375
- Left = 6480
- TabIndex = 8
- Top = 4080
- Width = 855
- End
- Begin VB.ListBox List1
- BeginProperty Font
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 4350
- ItemData = "Form5.frx":0000
- Left = 120
- List = "Form5.frx":0002
- Sorted = -1 'True
- TabIndex = 4
- Top = 120
- Width = 3615
- End
- Begin VB.TextBox txtSubject
- Height = 315
- Left = 3960
- TabIndex = 1
- Top = 480
- Width = 3375
- End
- Begin VB.TextBox txtWord
- Height = 315
- Left = 3960
- TabIndex = 2
- Top = 1200
- Width = 3375
- End
- Begin VB.Label lblCopying
- AutoSize = -1 'True
- Caption = "Copying..............."
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 300
- Left = 5520
- TabIndex = 11
- Top = 3600
- Visible = 0 'False
- Width = 1755
- End
- Begin VB.Label Label1
- Caption = $"Form5.frx":0004
- Height = 855
- Left = 3840
- TabIndex = 10
- Top = 2280
- Width = 3495
- End
- Begin VB.Label lblData
- AutoSize = -1 'True
- Caption = "Subject:"
- Height = 195
- Index = 1
- Left = 3960
- TabIndex = 9
- Top = 240
- Width = 585
- End
- Begin VB.Label lblData
- AutoSize = -1 'True
- Caption = "Word:"
- Height = 195
- Index = 0
- Left = 3960
- TabIndex = 0
- Top = 960
- Width = 435
- End
- Attribute VB_Name = "Form5"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim ListNum
- Private Sub cmdAdd_Click()
- Dim tempsub
- Dim tempword
- Dim temp
- Dim temp2
- Dim num1
- Dim num2
- If Len(txtSubject) > 30 Then
- Dim response
- Dim sublen2
- Dim sublen
- sublen = Len(txtSubject.Text)
- response = MsgBox("The subect is" + Str(sublen) + " letters long, please don't use more then 30 letters.", vbOKOnly + vbExclamation, "Error")
- Exit Sub
- End If
- tempsub = txtSubject.Text
- tempword = txtWord.Text
- num1 = Len(tempsub)
- num2 = 30 - num1
- Do While num2 > 0
- temp2 = temp2 + " "
- num2 = num2 - 1
- Loop
- temp = tempsub + temp2 + tempword
- Dim num3
- num3 = Len(temp)
- List1.AddItem temp
- txtWord = ""
- txtSubject = ""
- txtSubject.SetFocus
- End Sub
- Private Sub cmdClose_Click()
- Form2.Enabled = True
- Unload Me
- End Sub
- Private Sub cmdDelete_Click()
- List1.RemoveItem ListNum
- List1.ListIndex = ListNum - 1
- If List1.ListCount < 1 Then
- cmdDelete.Enabled = False
- cmdModify.Enabled = False
- End If
- End Sub
- Private Sub cmdModify_Click()
- Dim temp
- Dim tempsub
- Dim tempword
- temp = List1.Text
- tempsub = Left(temp, 30)
- tempsub = Trim(tempsub)
- tempword = Mid(temp, 31)
- txtSubject.Text = tempsub
- txtWord.Text = tempword
- End Sub
- Private Sub cmdOk_Click()
- If List1.ListCount = 0 Then
- Dim response
- response = MsgBox("You must have at least one entry in the list.", vbOKOnly + vbExclamation, "Error")
- Exit Sub
- End If
- Dim AddNum
- Dim AddTemp
- lblCopying.Visible = True
- Form5.Refresh
- List1.Visible = False
- Form5.Enabled = False
- AddNum = 0
- Set fs = CreateObject("Scripting.FileSystemObject")
- Set a = fs.CreateTextFile("c:\windows\temp\tempfile.txt", True)
- Do While AddNum <> List1.ListCount
- List1.ListIndex = AddNum
- AddTemp = List1.Text
- a.WriteLine (AddTemp)
- AddNum = AddNum + 1
- Loop
- a.Close
- FileCopy "C:\windows\temp\tempfile.txt", "Dictionary.txt"
- Form5.Enabled = True
- Form2.Enabled = True
- List1.Visible = True
- lblCopying.Visible = False
- Dim del As Object
- Kill "C:\windows\temp\tempfile.txt"
- Unload Me
- End Sub
- Private Sub Form_Load()
- Dim AddIt
- Open "dictionary.txt" For Input As #1 ' Open file for input.
- Do While Not EOF(1) ' Check for end of file.
- Line Input #1, AddIt ' Read line of data.
- List1.AddItem AddIt ' Print to the Immediate window.
- Loop
- Close #1 ' Close file.
- End Sub
- Private Sub Label1_Click()
- End Sub
- Private Sub List1_Click()
- If List1.ListCount > 0 Then
- cmdModify.Enabled = True
- cmdDelete.Enabled = True
- cmdModify.Default = True
- End If
- ListNum = List1.ListIndex
- End Sub
- Private Sub txtSubject_Change()
- txtSubject.MaxLength = 30
-
- If txtWord.Text = "" Then
- cmdAdd.Enabled = False
- cmdOk.Default = True
- Else
- If txtSubject = "" Then
- cmdAdd.Enabled = False
- cmdOk.Default = True
- Else
- cmdAdd.Enabled = True
- cmdAdd.Default = True
- End If
- End If
- End Sub
- Private Sub txtSubject_Click()
- cmdDelete.Enabled = False
- cmdModify.Enabled = False
- cmdOk.Default = True
- If txtWord.Text = "" Then
- cmdAdd.Enabled = False
- cmdOk.Default = True
- Else
- If txtSubject = "" Then
- cmdAdd.Enabled = False
- cmdOk.Default = True
- Else
- cmdAdd.Enabled = True
- cmdAdd.Default = True
- End If
- End If
- End Sub
- Private Sub txtWord_Change()
- txtWord.MaxLength = 35
- If txtWord.Text = "" Then
- cmdAdd.Enabled = False
- cmdOk.Default = True
- Else
- If txtSubject = "" Then
- cmdAdd.Enabled = False
- cmdOk.Default = True
- Else
- cmdAdd.Enabled = True
- cmdAdd.Default = True
- End If
- End If
- cmdDelete.Enabled = False
- cmdModify.Enabled = False
- End Sub
- Private Sub txtWord_Click()
- cmdDelete.Enabled = False
- cmdModify.Enabled = False
- cmdOk.Default = True
- If txtWord.Text = "" Then
- cmdAdd.Enabled = False
- cmdOk.Default = True
- Else
- If txtSubject = "" Then
- cmdAdd.Enabled = False
- cmdOk.Default = True
- Else
- cmdAdd.Enabled = True
- cmdAdd.Default = True
- End If
- End If
- End Sub
- Private Sub txtWord_GotFocus()
- txtWord.SelStart = 0
- txtWord.SelLength = Len(txtWord.Text)
- End Sub
- Private Sub txtSubject_GotFocus()
- txtSubject.SelStart = 0
- txtSubject.SelLength = Len(txtSubject.Text)
- End Sub
-